import request from '@/utils/request'

export const getListApi = (params) => request.get('/parking/card/list', { params })

export const createCardApi = (data) => request.post('/parking/card', data)

/**
 * 获取月卡详情
 * @data
 * @returns
 */
export const getCardDetailApi = (id) => request.get(`/parking/card/detail/${id}`)

/**
 * 更新月卡
 * @param {*} data
 * @returns
 */
export const updateCardApi = (data) => request.put('/parking/card/edit', data)

/**
 * 删除月卡
 * @param {*} id
 * @returns
 */
export const delCardApi = (id) => request.delete(`/parking/card/${id}`)

/**
 * 批量删除月卡
 * @param {*} ids [1,2,3]
 * @returns
 */
export function delAllCardApi(ids) {
  return request({
    url: `/parking/card/${ids.join(',')}`,
    method: 'DELETE'
  })
}
